<template>
  <!-- 规则历史页面 -->
  <div style="margin-bottom:20px;">
        <el-table ref="multipleTable" :data="tableData" width="calc(100% - 10px)">

          <el-table-column prop="sceneId" align="center" header-align="center"
					:filter-multiple="true" type="selection">
				  </el-table-column>
          <el-table-column
            prop="sceneCode"
            label="情景编号"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column label="情景名称" prop="sceneName" align="center" header-align="center"
					:show-overflow-tooltip="true">
				  </el-table-column> 
          <el-table-column label="定价方法" prop="methodComment" align="center" header-align="center"
					:show-overflow-tooltip="true">
				</el-table-column>
				<el-table-column label="定价曲线" prop="curveComment" align="center" header-align="center"
					:show-overflow-tooltip="true">
				</el-table-column>
				<el-table-column label="调整项" prop="adjComment" align="center" header-align="center"
					:show-overflow-tooltip="true">
				</el-table-column>
				<el-table-column label="是否默认" prop="defaultFlag" align="center" header-align="center"
					:show-overflow-tooltip="true">
					<template slot-scope="scope">
						<span v-if="scope.row.defaultFlag==1"> 是 </span>
						<span v-if="scope.row.defaultFlag==0"> 否 </span>
					</template>
				</el-table-column>
				<el-table-column label="是否BREAKFUNDING" prop="fundingFlag" align="center"
					header-align="center" :show-overflow-tooltip="true">
					<template slot-scope="scope">
						<span v-if="scope.row.fundingFlag==1"> 是 </span>
						<span v-if="scope.row.fundingFlag==0"> 否 </span>
					</template>
				</el-table-column>
				<el-table-column label="是否BREAKCHARGE" prop="chargeFlag" align="center"
					header-align="center" :show-overflow-tooltip="true">
					<template slot-scope="scope">
						<span v-if="scope.row.chargeFlag==1"> 是 </span>
						<span v-if="scope.row.chargeFlag==0"> 否 </span>
					</template>
				</el-table-column>
				<el-table-column label="是否有效" prop="sceneStatus" align="center" header-align="center"
					:show-overflow-tooltip="true">
					<template slot-scope="scope">
						<span v-if="scope.row.sceneStatus==1"> 是 </span>
						<span v-if="scope.row.sceneStatus==0"> 否 </span>
					</template>
				</el-table-column>
				<el-table-column label="版本号" prop="versionNum" align="center" header-align="center"
					:show-overflow-tooltip="true">
				</el-table-column>
          <el-table-column
            prop="creator"
            label="创建人"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            prop="createdTm"
            :show-overflow-tooltip="true"
            label="创建时间"
            sortable
          >
            <template slot-scope="scope">
              <div v-if="scope.row.createdTm">
                {{ timeFormat(scope.row.createdTm) }}
              </div>
              <div v-else>-</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="modifier"
            :show-overflow-tooltip="true"
            label="修改人"
            sortable
            :formatter="row => row.modifier || '-'"
          >
          </el-table-column>
          <el-table-column
            prop="modifiedTm"
            :show-overflow-tooltip="true"
            label="修改时间"
            sortable
          >
            <template slot-scope="scope">
              <div v-if="scope.row.createdTm">
                {{ timeFormat(scope.row.modifiedTm) }}
              </div>
              <div v-else>-</div>
            </template>
          </el-table-column>
        </el-table>
         <pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="page"
          :page-size="size"
          @refresh="searchFunc"
          :total="total"
        ></pagination>
  </div>
</template>

<script>
import moment from "moment";
import { getDict } from "@/api/getDict";
export default {
  data() {
    return {
        page: 1,
        size: 15,
    };
  },
 props: ["tableData","total"],
  components: {
    
  },
  created() {
    
  },
  mounted() {
  },
  
  methods: {
      handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
     this.$emit("handleSizeChange", val)
    },
    //当前页改变
    handleCurrentChange(val) {
      this.$emit("handleCurrentChange", val)
    },
    searchFunc(){
      this.$emit("searchFunc")
    },
     
     timeFormat(val) {
      if (val) return moment(val).format("YYYY-MM-DD HH:mm:ss");
      else return "";
    },
    timeFormatShort(val) {
      if (val) return moment(val).format("YYYY-MM-DD");
      else return "";
    },

 
  }
};
</script>

<style lang="scss" scoped>

</style>